using System;

namespace Framework.Interop
{
    /// <summary>
    /// An flags that indicate the content and validity of the <see cref="ShellExecuteInfo">ShellExecuteInfo</see> members.
    /// <seealso>
    /// Native <see cref="http://msdn.microsoft.com/en-us/library/bb759784.aspx">flags</see>
    /// </seealso>
    /// </summary>
    [Flags]
    internal enum ShellExecuteOptions
    {
        ///<summary>
        /// Default mask
        ///</summary>
        Default = 0x00000000,

        ///<summary>
        /// Use the class name given by the <see cref="ShellExecuteInfo.lpClass">lpClass</see> member.
        /// If both <see cref="ClassKey">ClassKey</see> and <see cref="ClassName">ClassName</see> are set, the class key is used.
        ///</summary>
        ClassName = 0x00000001,

        ///<summary>
        /// Use the class key given by the <see cref="ShellExecuteInfo.hkeyClass">hkeyClass</see> member.
        /// If both <see cref="ClassKey">ClassKey</see> and <see cref="ClassName">ClassName</see> are set, the class key is used.
        ///</summary>
        ClassKey = 0x00000003,

        ///<summary>
        /// Use the item identifier list given by the <see cref="ShellExecuteInfo.lpIDList">lpIDList</see> member.
        /// The <see cref="ShellExecuteInfo.lpIDList">lpIDList</see> member must point to an <see cref="ItemIDList">ItemIDList</see> structure.
        ///</summary>
        IDList = 0x00000004,

        ///<summary>
        /// Use the <see cref="IContextMenu">IContextMenu</see> interface of the selected item's shortcut menu handler.
        /// Use either <see cref="ShellExecuteInfo.lpFile">lpFile</see> to identify the item by its file system path or
        /// <see cref="ShellExecuteInfo.lpIDList">lpIDList</see> to identify the item by its PIDL.
        /// This flag allows applications to use <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> to invoke verbs
        /// from shortcut menu extensions instead of the static verbs listed in the registry.
        /// <c>Note: InvokeIDList overrides and implies IDList</c>
        ///</summary>
        InvokeIDList = 0x0000000c,

        ///<summary>
        /// <para>
        /// Use the icon given by the <see cref="ShellExecuteInfo.hIconMonitor">hIcon</see> member.
        /// This flag cannot be combined with <see cref="HMonitor">HMonitor</see>.
        /// </para>
        /// <para>
        /// <c>Note: This flag is used only in Windows XP and earlier. It is ignored in Windows Vista
        /// and later versions of Windows.</c>
        /// </para>
        ///</summary>
        Icon = 0x00000010,

        ///<summary>
        /// Use the keyboard shortcut given by the <see cref="ShellExecuteInfo.dwHotKey">dwHotKey</see> member.
        ///</summary>
        HotKey = 0x00000020,

        ///<summary>
        /// Use to indicate that the <see cref="ShellExecuteInfo.hProcess">hProcess</see> member receives the process handle.
        /// This handle is typically used to allow an application to find out when a process created with
        /// <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> terminates. In some cases, such as when execution is satisfied
        /// through a DDE conversation, no handle will be returned. The calling application is responsible for closing the handle
        /// when it is no longer needed.
        ///</summary>
        NoCloseProcess = 0x00000040,

        ///<summary>
        /// Validate the share and connect to a drive letter. This enables reconnection of disconnected network drives.
        ///  The <see cref="ShellExecuteInfo.lpFile">lpFile</see> member is a UNC path of a file on a network.
        ///</summary>
        ConnectNetDrv = 0x00000080,

        /// <summary>
        /// <para>
        /// Wait for the execute operation to complete before returning. This flag should be used by callers that are using
        /// <see cref="http://msdn.microsoft.com/en-us/library/bb762153.aspx">ShellExecute</see> forms that might result in
        /// an async activation, for example DDE, and create a process that might be run on a background thread.
        /// Calls to <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> from processes already running on background threads
        /// should always pass this flag. Also, applications that exit immediately after calling
        ///  <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> should specify this flag.
        /// </para>
        /// <para>
        /// <c>Note: <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> runs on a background thread by default if
        /// the caller's threading model is not Apartment.</c>
        /// </para>
        /// <para>
        /// If the execute operation is performed on a background thread and the caller did not specify the
        /// <see cref="AsyncOk">AsyncOk</see> flag, then the calling thread waits until the new process has started before returning.
        /// This typically means that either <see cref="http://msdn.microsoft.com/en-us/library/ms682425.aspx">CreateProcess</see>
        /// has been called, the DDE communication has completed, or that the custom execution delegate has notified
        /// <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> that it is done. If the
        /// <see cref="WaitForInputIdle">WaitForInputIOdle</see> flag is specified, then <see cref="Shell32.ShellExecuteEx">
        /// calls <see cref="WaitForInputIdle">WaitForInputIOdle</see> and waits for the new process to idle before returning,
        /// with a maximum timeout of 1 minute.
        /// </para>
        /// <para>
        /// For further discussion on when this flag is necessary, see
        /// <see cref="http://msdn.microsoft.com/en-us/library/bb759784.aspx">documentation on MSDN</see>.
        /// </para>
        /// </summary>
        NoAsync = 0x00000100,

        ///<summary>
        /// Do not use; use <see cref="NoAsync">NoAsync</see> instead.
        ///</summary>
        FlagDDEWait = 0x00000100,

        ///<summary>
        /// Expand any environment variables specified in the string given by
        /// the <see cref="ShellExecuteInfo.lpDirectory">lpDirectory</see> or <see cref="ShellExecuteInfo.lpFile">lpFile</see> member.
        ///</summary>
        DoEnvSubst = 0x00000200,

        ///<summary>
        /// Do not display an error message box if an error occurs.
        ///</summary>
        FlagNoUi = 0x00000400,

        ///<summary>
        /// Use this flag to indicate a Unicode application.
        ///</summary>
        Unicode = 0x00004000,

        ///<summary>
        /// Use to create a console for the new process instead of having it inherit the parent's console.
        /// It is equivalent to using a <see cref="http://msdn.microsoft.com/en-us/library/ms684863.aspx">CREATE_NEW_CONSOLE</see>
        /// flag with <see cref="http://msdn.microsoft.com/en-us/library/ms682425.aspx">CreateProcess</see>.
        ///</summary>
        NoConsole = 0x00008000,

        ///<summary>
        /// <c>Microsoft Windows NT 4.0 Service Pack 6 (SP6), Windows 2000 SP3 and later.</c> The execution can be performed on
        /// a background thread and the call should return immediately without waiting for the background thread to finish.
        /// Note that in certain cases ShellExecuteEx ignores this flag and waits for the process to finish before returning.
        ///</summary>
        AsyncOk = 0x00100000,

        ///<summary>
        /// <c>Internet Explorer 5.0 and later.</c> Not used.
        ///</summary>
        NoQueryClassStore = 0x01000000,

        ///<summary>
        /// Use this flag when specifying a monitor on multi-monitor systems. The monitor is specified in
        /// the <see cref="ShellExecuteInfo.hIconMonitor">hMonitor</see> member. This flag cannot be combined with
        /// <see cref="Icon">Icon</see>.
        ///</summary>
        HMonitor = 0x00200000,

        ///<summary>
        /// <c>Windows XP SP1 and later.</c> Do not perform a zone check. This flag allows
        /// <see cref="Shell32.ShellExecuteEx">ShellExecuteEx</see> to bypass zone checking put into place by
        /// <see cref="http://msdn.microsoft.com/en-us/library/bb776297.aspx">IAttachmentExecute</see>.
        ///</summary>
        NoZoneChecks = 0x00800000,

        ///<summary>
        /// <c>Internet Explorer 5.0 and later.</c> After the new process is created, wait for the process to become idle before
        /// returning, with a one minute timeout.
        /// See <see cref="http://msdn.microsoft.com/en-us/library/ms687022.aspx">WaitForInputIdle</see> for more details.
        ///</summary>
        WaitForInputIdle = 0x02000000,

        ///<summary>
        /// <c>Windows XP and later.</c> Keep track of the number of times this application has been launched.
        /// Applications with sufficiently high counts appear in the Start Menu's list of most frequently used programs.
        ///</summary>
        FlagLogUsage = 0x04000000
    } ;
}
